// sqlMap.js  sql语句
const sqlMap = {
  Stu: {
    // add: 'insert into axios_demo(stu_Id,stu_name,stu_sex,stu_college,stu_class) values (0,?,?,?,?)',
    // show: 'select * from axios_demo',
    // del: 'delete from axios_demo where stu_Id = ?',
    // update: 'update axios_demo set stu_name = ?,stu_sex = ?,stu_college = ?,stu_class = ? where stu_Id = ?'
    show: 'select * from test limit 5',
    update:'update test set username= "李四" where id = 3',
    del: 'delete from test where id = ?',
  },
  HomeGoods:{
    goodsSort: 'select * from goods where sort = ? limit ?',
    update:'update test set name= "test" where id = 1',
    
  },
  GoodsItem:{
    // 商品详情信息goodsitem，没有建表，伪造数据使用goods表
    itemDetial: 'select * from goods where gid = ? ',
    // 购物车商品列表
    cartList: `SELECT * FROM goods a 
    join shop_cart b    
    where a.gid=b.gid and b.userid ='张三'`

  },

  GoodsInsert:{
    // 数据写入
    //1、添加购物车
    addCart:`insert into shop_cart VALUES (?,?)`
  }
}

module.exports = sqlMap